package com.tedu;


public class Test009 {
    public static void main (String[] args) {
        int a[] = {1, 2, 34, 5, 6};
        int a1[] = {11, 2, 34, 5, 6, 9};


        //   求 数组a的   所有元素    和
        int sum = 0;
        for (int i = 0; i < a1.length; i++) {
            sum += a1[i];
        }

//        for (int i = 0; i < a.length; i++) {
//            sum=a[i]+sum;
//        }


        System.out.println("sum = " + sum);
    }
}
